/* -*- mode: c++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- */

#ifndef _TOKENHELPER_H_
#define _TOKENHELPER_H_

#include <dybuf.h>

#include <string>

struct TokenOut {
    std::string         text;

    int                 lineno;
};

struct TokenIn {
    DyBuf              *dybuf;

    char                comment_char;

    std::string         delimiter;

    int                 lineno;

    bool                handle_quote_string;

    TokenIn() : dybuf(NULL)
              , comment_char('#')
              , delimiter(" \t\r\n\f")
              , lineno(1)
              , handle_quote_string(true)
    {
    }

    TokenIn(DyBuf *db) : dybuf(db)
                       , comment_char('#')
                       , delimiter(" \t\r\n\f")
                       , lineno(1)
                       , handle_quote_string(true)
    {
    }
};

extern bool tk_next(TokenIn& in, TokenOut& out);

#endif /* _TOKENHELPER_H_ */
